package com.atguigu.yygh.hosp.controller.admin;

/*==========================================
      时 间:   2022-04-15
      讲 师:   刘  辉
      描 述:   尚硅谷教学团队
 ==========================================*/


import com.atguigu.yygh.model.acl.User;
import com.atguigu.yygh.result.R;
import com.atguigu.yygh.vo.acl.UserQueryVo;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/user")
public class UserController {


    //用户登录
    @PostMapping("/login")
    public R login(@RequestBody UserQueryVo userQueryVo){
        System.out.println(userQueryVo);
        return R.ok().data("token","admin-token");
    }

    @GetMapping("/info")
    public R info(String token){
        System.out.println(token);

        return R.ok()
                .data("roles","[admin]")
                .data("introduction", "I am a super administrator")
                .data("avatar", "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fhbimg.b0.upaiyun.com%2Fe10b87fe3e6ecf00d08d7019a03e1009b919665d604ab4-HlNoRx_fw658&refer=http%3A%2F%2Fhbimg.b0.upaiyun.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1652582514&t=b1e081ea5aeda7939f7889c5f1757604")
                .data("name","Super Admin");
    }

}
